<?php
/**
 * Image.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-02-18 16:35:59
 * @modified    2023-02-18 16:35:59
 *
 */

namespace App\Models\WorkOrder;

use App\Models\BaseModel;
use App\Services\ImageServ;

class Image extends BaseModel
{
    protected $table = 'work_order_images';

    protected $fillable = [
        'work_order_id',
        'image',
    ];

    protected $appends = [
        'img_url'
    ];

    public function getImgUrlAttribute()
    {
        $img = $this->image;
        $url = (new ImageServ($img))->getUrl();
        return $url;
    }
}